package com.zxk.version4.core;

import lombok.Builder;
import lombok.Data;

import java.io.Serializable;

/**
 * @author 朱小康
 */

@Data
@Builder
public class RpcResponse implements Serializable {

    private Integer code;

    private String message;

    private Object data;

    public static RpcResponse success(Object data){
        return RpcResponse.builder().code(200).message("请求成功").data(data).build();
    }

    public static RpcResponse fail(){
        return RpcResponse.builder().code(500).message("请求异常").build();
    }
}
